set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


--CREATEd:02/08/2010
--Author: nnamthach@gmail.com
Create procedure [dbo].[procUser_get_Test_ByUsername](
@Username as nchar(100)
)
AS
BEGIN 
SELECT     Test.Name, Test.Duration_Time, Test.Type, SUM(Test_Log.Score) AS Score, Test_Log.No
FROM         [User] INNER JOIN
                      Test_Log ON [User].ID = Test_Log.User_ID INNER JOIN
                      Test ON Test_Log.Test_ID = Test.ID
GROUP BY Test.Name, Test.Duration_Time, Test.Type, [User].Username, Test_Log.No
HAVING      ([User].Username = @Username)

END



